<script>
import Vue from "vue";

export default {
	globalData: {

  },
	onLaunch: function () {
    var self = this;
		uni.getSystemInfo({
			success: function (e) {
				// #ifndef MP
				Vue.prototype.StatusBar = e.statusBarHeight;
				if (e.platform == "android") {
					Vue.prototype.CustomBar = e.statusBarHeight + 50;
				} else {
					Vue.prototype.CustomBar = e.statusBarHeight + 45;
				}
				// #endif

				// #ifdef MP-WEIXIN
				Vue.prototype.StatusBar = e.statusBarHeight;
				let custom = wx.getMenuButtonBoundingClientRect();
				Vue.prototype.Custom = custom;
				Vue.prototype.CustomBar =
					custom.bottom + custom.top - e.statusBarHeight;
				// #endif

				// #ifdef MP-ALIPAY
				Vue.prototype.StatusBar = e.statusBarHeight;
				Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
				// #endif

				// 获取屏幕高度和宽度
				var windowHeight = e.windowHeight;
				var windowWidth = e.windowWidth;
				self.globalData = {
					...self.globalData,
					windowWidth,
					windowHeight,
				};
			},
		});
	},
	onShow: function () {
		console.log("App Show");

		// 初次启动加载项：
		// 个人参与的挑战列表
		// const playerId = this.$store.state.loginedUser.id;
		// this.$store.dispatch("player_wish/getPlayerWishs", playerId);

		// 标签列表
		this.$store.dispatch("fetch_all_tags");
	},
	onHide: function () {
		console.log("App Hide");
	},
};
</script>

<style lang="scss">
@import "uview-ui/index.scss";

/*每个页面公共css */
/* #ifndef APP-PLUS-NVUE */
/* uni.css - 通用组件、模板样式库，可以当作一套ui库应用 */
/* #endif */

@import "./common/uni.css";

/* H5 兼容 pc 所需 */
/* #ifdef H5 */
@media screen and (min-width: 768px) {
	body {
		overflow-y: scroll;
	}
}

uni-page-body {
	background-color: #f5f5f5 !important;
	min-height: 100% !important;
	height: auto !important;
}

.uni-top-window uni-tabbar .uni-tabbar {
	background-color: #fff !important;
}

.uni-app--showleftwindow .hideOnPc {
	display: none !important;
}

/* #endif */
</style>
